package com.codejiwei.flink.zk;

import org.apache.flink.shaded.curator4.org.apache.curator.framework.CuratorFramework;
import org.apache.flink.shaded.curator4.org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.flink.shaded.curator4.org.apache.curator.retry.ExponentialBackoffRetry;

import java.io.Serializable;

/**
 * @author jiwei
 * @description
 * @date 2023/9/8 9:24
 */
public class ZkClient implements Serializable {
    private String connect;
    private transient CuratorFramework client;
    public ZkClient(String connectString) {
        this.connect = connectString;
        client = CuratorFrameworkFactory.newClient(connectString, new ExponentialBackoffRetry(1000, 3));
    }

    public String getConnect() {
        return connect;
    }

    public void setConnect(String connect) {
        this.connect = connect;
    }

    public CuratorFramework getClient() {
        return client;
    }

    public void setClient(CuratorFramework client) {
        this.client = client;
    }
}
